/**
////////////////////////////////////////////////////////////////////////////////
//                                                                            // 
//  Copyright (c) 2013 Santiago Benito Rebollo. Eclipse Public License - v 1.0//
//  @author Santiago Benito Rebollo.                                          // 
//  santiago.benito.rebollo@gmail.com                                         //
//                                                                            //  
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC// 
// LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM//
// CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.                      //
//                                                                            //
// A Contributor may choose to distribute the Program in object code form     //
// under its own license agreement, provided that:                            //
//                                                                            //
// a) it complies with the terms and conditions of this Agreement; and        //
// b) its license agreement:                                                  //
//                                                                            //
// i) effectively disclaims on behalf of all Contributors all warranties and  //
// conditions, express and implied, including warranties or conditions of     //  
// title and non-infringement, and implied warranties or conditions of        //
// merchantability and fitness for a particular purpose;                      //
// ii) effectively excludes on behalf of all Contributors all liability for   //
// damages, including direct, indirect, special, incidental and consequential //
// damages, such as lost profits;                                             //
// iii) states that any provisions which differ from this Agreement are       //
// offered by that Contributor alone and not by any other party; and          //
// iv) states that source code for the Program is available from such         //
// Contributor, and informs licensees how to obtain it in a reasonable        //
// manner on or through a medium customarily used for software exchange.      //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
 */

/**
CmIdentification
////////////////////////////////////////////////////////////////////////////////
// Version History:
// [Rev d.d dd Mmm yyyy hh:mm:ss    <logComment>]
$Log: TestKruskal.java,v $
////////////////////////////////////////////////////////////////////////////////
 */


package com.chago.fastrecado;

import java.util.TreeSet;

/**
 * This class has the main method for running the kruskal algorithm.
 * 
 * @author Santiago Benito Rebollo
 * @author santiago.benito.rebollo@gmail.com
 */
public class TestKruskal {

    /**
     * This is the main. All of this method is only for testing and the code could not be "ethical"
     * 
     * @param String[] args is not used
     * @pre $none
     * @post $none
     */
/*
	public static void main(String[] args)
    {

        // MapOfCities is used for store the graph of cities.
  		Vertice[] MapOfCities = DataLoader.buildMap("http://www.cookiesmania.es/ciudades4.txt");

  		//TreeSet is used to sort the edges before passing to the algorithm
        TreeSet<Edge> edges = new TreeSet<Edge>();

		// show the cities
		DataLoader.showCities (MapOfCities);
        
        Kruskal kk = new Kruskal();

        // for each vertex, obtain the Edged List.
        for (int i=0;i<MapOfCities.length;i++) {
        	
        	Vertice v = MapOfCities[i];
        	Arista[] adjacencies = v.getAdjancencies();
        	if (adjacencies!=null) {
        		for (int j=0;j<adjacencies.length;j++){
        			Arista a = adjacencies[j];
        			a.enableDistance();
        			
        			edges.add(new Edge(v.name,
        					           a.target.name,
        					           a.getWeight()));

        		}// for j (adjacency)
        	}

        }// for i (vertex)
        
        //TreeSet is used to sort the edges before passing to the algorithm

        for (Edge edge : edges) {
            kk.insertEdge(edge);
        }        
        
        System.out.println("--------------------------Kruskal algorithm-------------------");
        int total = 0;
        for (Edge edge : kk.getEdges()) {
            System.out.println(edge);
            total += edge.getWeight();
        }
        System.out.println("Total weight is " + total);
        
    }
*/

}
